package com.ruoyi.comment.service.impl;


import com.ruoyi.comment.domain.TbComment;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.concurrent.Future;

@Service
public class TbCommentAsyncServiceImpl {

    @Resource
    private TbCommentServiceImpl tbCommentService;

//    @Async
    Future<List<TbComment>> listTreeAsync(TbComment parentComment) {
        TbComment tbComment = new TbComment();
        tbComment.setParentId(parentComment.getId());
        tbComment.setPostId(parentComment.getPostId());
        return new AsyncResult<>(tbCommentService.selectTbCommentList(tbComment));
    }
}
